home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / utility / convr707.zip / CONVERT.DOC < prev    next >
Text File  |  1997-07-31  |  32KB  |  687 lines

  1. CONVERT.DOC                            1                           Jul 31, 1997
  2.  
  3. WIN95 AND WINNT NOTICE:  As with most DOS-based utilities, this program doesn't
  4. understand the weird subdirectories, long filenames,  invalid  characters  that
  5. are possible under Windows 95 and Windows/NT.   Both  operating  systems  alias
  6. long filenames into names like MYFILE~1.TXT and you will need  to  specify  the
  7. aliased versions of file names to process  them.   Under  some  file  structure
  8. systems in NT, the program may not work at all.
  9.  
  10. The CONVERT.EXE program converts  data  between  several  basic  data  formats.
  11. Features:
  12.  
  13.   * You can read data in from any of the following data formats:
  14.        ASCII-delimited
  15.        fixed field
  16.        dBase-compatible
  17.   * You can write data out in any of the following data formats:
  18.        ASCII-delimited
  19.        fixed field
  20.        dBase-compatible
  21.        WKS (Lotus 1-2-3 release 1 compatible)
  22.   * For ASCII-delimited files, you can  specify  the  delimiters  used  between
  23.     fields as well as around numeric or character data.
  24.   * For dBase input files, you can retain deleted records if you want.
  25.   * You can resize variables or drop them entirely if desired.
  26.   * You can add fields as desired and assign initial values to them.
  27.   * You can specify up to 10 include filters; all records processed  must  meet
  28.     at least one of these filter conditions.
  29.   * You can specify up to 10 exclude filters;  any  records  which  meet  these
  30.     filter conditions are dropped.
  31.   * For WKS output files, you can process input files bigger than  Lotus  1-2-3
  32.     itself can import (1-2-3 limits input records to being  240  characters  or
  33.     less).
  34.   * For WKS output files, you can specify the column width in addition  to  the
  35.     output field width (since spreadsheets flow text into the  next  unoccupied
  36.     cell).
  37.   * Cell filters can be created, ignoring, say, any record where the  value  in
  38.     cell 4 is less than 10.
  39.   * The program can only  handle  files  with  255  fields  or  fewer.   (Those
  40.     obsessed with handling more fields can ask for a version that does so.)
  41.   * Handles DOS text files (lines end with CR/LF), Mac text  files  (lines  end
  42.     with CR), or Unix text files (lines end with LF).
  43.   * Pressing escape stops the program early.
  44.  
  45.  
  46.  
  47. CONVERT.DOC                            2                           Jul 31, 1997
  48.  
  49. Data format types:
  50.  
  51. An ASCII-delimited file is one which typically has double  quotes  around  each
  52. character field (the quotes are  optional  in  CONVERT)  and  typically  commas
  53. between fields.  Leading and trailing spaces are removed from character as well
  54. as all other values.
  55.  
  56. A fixed-field file places each field in  the  same  column  positions  on  each
  57. record.  The lengths of the fields are the same from record to record.
  58.  
  59. As an example, these might be an ASCII-delimited records:
  60.  
  61.         "Economic Bulletin Board","202 482-3870",35
  62.         "EBB High-Speed","202 482-2584",100
  63.  
  64. Fixed-field file records might look like this for the same data:
  65.  
  66.         Economic Bulletin Board 202 482-3870  35
  67.         EBB High-Speed          202 482-2584 100
  68.  
  69. (On files generated on a PC, most fixed-field file records  end  with  a  CR/LF
  70. combination.  Although these two characters actually add two characters to each
  71. line, most people and  programming  languages  ignore  them.   Files  generated
  72. elsewhere may not have these line terminators.  Use the /BINARY option if  this
  73. is the case.)
  74.  
  75. WKS files are supported directly by Lotus 1-2-3 (all versions) as well as  most
  76. other spreadsheet programs.  DBF files are supported  by  dBaseIII,  dBaseIII+,
  77. dBaseIV, and most other data base management programs (Paradox etc).
  78.  
  79.  
  80.  
  81. CONVERT.DOC                            3                           Jul 31, 1997
  82.  
  83. Field-definition file:
  84.  
  85. Unless you are reading a dBase file, this program requires  a  field-definition
  86. file to figure out the characteristics for each field and also to  set  certain
  87. file characteristics.  If you're processing an ASCII-delimited input file,  the
  88. routine can try to create a field-definition file for you if desired.
  89.  
  90. The  field-definition  file  can  be  created  with  any  text   editor.    The
  91. field-definition file consists of several records with, for field type records,
  92. the following fields in the following order separated by spaces.  Most  of  the
  93. fields are optional.  Except for the record type indicator (which must begin in
  94. column 1), all other fields can be placed in any physical columns:
  95.  
  96.    (1) REQUIRED: Record type, usually field type as well
  97.    (2) REQUIRED: Length of field on input
  98.    (3) OPTIONAL (REQUIRED if Length of Field  specified):   Number  of  decimal
  99.        places for numeric data on output; if you don't know, put  a  "?"  here;
  100.        for non-numeric data, a "0" is fine; defaults to 0
  101.    (4) OPTIONAL: Length of field on output (if the field is wider than this, it
  102.        will be truncated to fit into this length); defaults to being  the  same
  103.        as the input field width
  104.    (5) OPTIONAL: For an output spreadsheet, width  of  column  in  form  "[wn]"
  105.        (e.g. "[W5]");  character  fields  wider  than  this  will  extend  into
  106.        subsequent columns if nothing is already in those columns
  107.    (6) OPTIONAL: Field description (e.g. variable name)
  108.    (7) OPTIONAL: Filter condition
  109.  
  110. The following are all examples of valid field-definition file entries:
  111.  
  112.         C 25 0 20 [w10] Sample field || > "C"
  113.             where:
  114.                 "C"     = character field
  115.                 "25"    = input field is maximum of 25 characters in length
  116.                 "0"     = there are no decimal places for this field
  117.                 "20"    = output field will be truncated to 20 characters
  118.                 "[w10]" = for spreadsheet, column will be displayed width
  119.                           10 and text longer than 10 will flow over to the
  120.                           next cells if there is nothing there
  121.                 "Sample field" = the name of the field; may be for comment
  122.                           purposes only
  123.                 "||"    = start of a filter
  124.                 > "C"   = the field will only show up if it begins with
  125.                           characters higher than "C"
  126.  
  127.         N 10 Value1
  128.             where:
  129.                 "N"     = character field
  130.                 "10"    = input field is maximum of ten characters in length;
  131.                           since decimal places are not specified, 0 presumed;
  132.                           since output field length is not specified, routine
  133.                           presumes it's the same as the input field so
  134.                           10 is presumed
  135.                 "Value1" = the name of the field
  136.  
  137.  
  138. CONVERT.DOC                            4                           Jul 31, 1997
  139.  
  140. Field types:
  141.  
  142.   The data record types accepted by this routine are as follows:
  143.  
  144.           type C = character data (leading spaces are trimmed)
  145.                V = verbatim character data (no leading spaces are trimmed)
  146.                N = numeric
  147.                L = logical (T or F)
  148.                D = date (in yyyymmdd format)
  149.                M = memo fields (only for dBase input files; ignored on output)
  150.  
  151. The field specifying records should be in the order the fields are found in the
  152. source file.  In other words, don't define a character field and then a numeric
  153. field if your data are actually numeric and then character.
  154.  
  155. Accounting for all fields in fixed field data:
  156.  
  157.   For fixed field files, you have to account for every byte in  the  file.   If
  158.   you have something like this:
  159.  
  160.           12345678_1_2345678_2_2345678_3      (column positions)
  161.           APPLE    X Y    12 BANANAS
  162.  
  163.   Even though you may think you only have five fields, the following .DEF  file
  164.   will NOT work:
  165.  
  166.           ; Bad .DEF file:  Note does not account for blank spaces
  167.           ; NOTE:  Input and output lengths are the same (mistakenly) so left
  168.           ; out number of decimal places and output length for each record.
  169.           C   8 Fruit1
  170.           C   1 Class1
  171.           C   1 Class2
  172.           N   5 Value
  173.           C  11 Fruit2
  174.  
  175.   You may want the Fruit1 field to be in columns 1 through 8 and Class1  to  be
  176.   in column 10 but the routine will not know to skip column 9 so it will  start
  177.   reading Class1 beginning in column 9, Class2 beginning in column 10, etc.  To
  178.   drop the blank positions, you have to add dummy fields on input and  ask  for
  179.   them to be dropped on output:
  180.  
  181.           ; Good .DEF file:  Spaces between fields are accounted for
  182.           C   8       Fruit1
  183.           C   1 0   0 Filler
  184.           C   1       Class1
  185.           C   1 0   0 Filler
  186.           C   1       Class2
  187.           C   1 0   0 Filler
  188.           N   5       Value
  189.           C   1 0   0 Filler
  190.           C  11       Fruit2
  191.  
  192.  
  193. CONVERT.DOC                            5                           Jul 31, 1997
  194.  
  195.   You can also use the input field length and output field  lengths  to  either
  196.   drop fields using other formats (by specifying a zero length for  the  output
  197.   field length) or for creating fields on output (by specifying a  zero  length
  198.   for the input field length).  You can also use this to expand on  contract  a
  199.   field.  For example, if Fruit1 is 8 characters long but you only want  it  to
  200.   occupy 4 characters on output (thus the field would be truncated), specify  8
  201.   for the input field length and 4 for the output field length:
  202.  
  203.           C 8 0 4 Fruit
  204.  
  205.   If the output field length is wider than the input  field  length,  the  data
  206.   values will be shifted right or left depending on the data type.  In general,
  207.   numeric fields are shifted right (so extra spaces show up  in  front  of  the
  208.   number) and all other field types (character, logical, or date)  are  shifted
  209.   left.
  210.  
  211.   You can have the routine create the  field-definition  file  it's  using  for
  212.   dBase and ASCII-delimited files.  This is controlled by  the  /OUTDEF=deffile
  213.   and /-OUTDEF parameters.
  214.  
  215.  
  216. ASCII-delimited file?  Letting the program guess the fields:
  217.  
  218.   Let's say you have some sort of ASCII-delimited file.  Do you have to  create
  219.   a field-definition file?  Nope.  The program will try to guess the format for
  220.   you if you want.
  221.  
  222.   For example, let's say you have  a  file  called  MYFILE.PRN  and  the  first
  223.   records look like this:
  224.  
  225. ACIN,970114, 1.49 , 1.5 , 1.49 , 1.495 , 2312512 , 0
  226. AGRO,970114, 1.3 , 1.4 , 1.3 , 1.4 , 68319 , 0
  227. ALPA,970114, .875 , .89 , .875 , .885 , 1805075 , 0
  228.  
  229.   Well, looking at it, you could probably  guess  that  it  has  8  fields  per
  230.   record, the first of which is character and the others are probably  numeric.
  231.   So you could create a field-definition file and go with that.  But let's  see
  232.   how the program does on its own.
  233.  
  234.   Looking at the fields, there  are  apparently  no  special  characters  (like
  235.   quotation marks) around the character fields.   There  are  also  no  special
  236.   characters around the numeric fields.  There are, however, commas between the
  237.   fields.
  238.  
  239.  
  240. CONVERT.DOC                            6                           Jul 31, 1997
  241.  
  242.   A standard  ASCII-delimited  file  would  have  quotation  marks  around  the
  243.   alphabetic fields.  Your's does not have this.  As a result, you will have to
  244.   specify a /DELIMS= parameter.  The format for this is:
  245.  
  246.           /DELIMS=aroundstrings,aroundnums,betweenfields
  247.  
  248.   In  your  case,  there  is  nothing   around   the   alphabetic   fields   so
  249.   "aroundstrings"  is  null.   There  is  nothing  around  numeric  fields   so
  250.   "aroundnums" is null. There are commas between fields so "betweenfields" is a
  251.   comma.  Thus, your /DELIMS= parameter is:
  252.  
  253.           /DELIMS=,,,
  254.  
  255.   So convert this file to a fixed-field file without having already  created  a
  256.   field-definition file, you would issue the following command:
  257.  
  258.           CONVERT MYFILE.PRN /FROM ASCII /TO FIXED /DELIMS=,,, /-INDEF /OUTDEF
  259.  
  260.   When the program runs, it will, in  this  case,  create  a  fixed-field  file
  261.   called MYFILE.FIX as well a field-definition file  called  MYFILE.DEF.   That
  262.   file would might like this:
  263.  
  264. ; Field definition file: C:\HOME\PRECIOS.DEF
  265. ; Created by CONVERT for FROM ASCII/FROM FIXED
  266. ; Created at 13:04:30 on 01-27-1997
  267. ; Positions in far left are positions on output
  268. N  10 4  10 COL_001                       In(   1:  10) Out(   1:  10)
  269. N   6 0   6 COL_002                       In(  11:  16) Out(  11:  16)
  270. N   7 4   7 COL_003                       In(  17:  23) Out(  17:  23)
  271. N   8 4   8 COL_004                       In(  24:  31) Out(  24:  31)
  272. N   7 4   7 COL_005                       In(  32:  38) Out(  32:  38)
  273. N   8 4   8 COL_006                       In(  39:  46) Out(  39:  46)
  274. N  11 9  11 COL_007                       In(  47:  57) Out(  47:  57)
  275. N   1 0   1 COL_008                       In(  58:  58) Out(  58:  58)
  276.  
  277.   You can modified this field-definition file if you'd like.  Maybe you want to
  278.   change the number of decimal places shown or expand some columns on output or
  279.   perhaps eliminate others.  Just edit the field-definition file  with  a  text
  280.   editor and resave it.  Then rerun the CONVERT command, this  time  specifying
  281.   that there *is* a field-definition file:
  282.  
  283.           CONVERT MYFILE.PRN /FROM ASCII /TO FIXED /DELIMS=,,,
  284.  
  285.  
  286.  
  287. CONVERT.DOC                            7                           Jul 31, 1997
  288.  
  289. Filters:
  290.  
  291. CONVERT supports two types of filters; record filters and cell (field) filters.
  292.  
  293. Record filters:
  294.  
  295.   In general, record filters  apply  to  the  record  as  a  whole.   They  are
  296.   specified as unique types of records in the field-definition file.
  297.  
  298.   You may specify up to 10 include record filters and up to 10  exclude  record
  299.   filters in the field-definition file.
  300.  
  301.   If an include record filter is specified, the input record  must  contain  at
  302.   least one of the specified character strings in order to be processed.  If an
  303.   exclude record filter is specified, any input record which  contains  any  of
  304.   the specified character strings will be ignored.   Record  filters  are  case
  305.   sensitive (capitalization matters) and processed as "or" items (if any filter
  306.   is met, the condition is met; record filters are not  combined  to  determine
  307.   fulfillment). Record filters are specified in the  field-definition  file  in
  308.   the following ways:
  309.  
  310.          /+=string  include filter, the string "string" can appear anywhere
  311.          /S+=string include filter, the string "string" is at the beginning  of
  312.                     the record
  313.          /+S=string include filter, the string "string" is at the  end  of  the
  314.                     record
  315.          /-=string  exclude filter, the string "string" can appear anywhere
  316.          /S-=string exclude filter, the string "string" is at the beginning  of
  317.                     the record
  318.          /-S=string exclude filter, the string "string" is at the  end  of  the
  319.                     record
  320.  
  321.   For example, if you want to specify in your control file that you  only  want
  322.   records that contain either "Japan" or "France" *and* you want to exclude any
  323.   records that begin with an underscore character, you would  need  to  include
  324.   the following three filter statements:
  325.  
  326.         /+=Japan
  327.         /+=France
  328.         /S-=_
  329.  
  330.   The character string can include hexadecimal codes (in the  &Hxx  format)  or
  331.   decimal codes (in the \ddd format) if necessary.  See BRUCEHEX.DOC file.
  332.  
  333.  
  334. CONVERT.DOC                            8                           Jul 31, 1997
  335.  
  336. Cell filters:
  337.  
  338.   Cell filters are applied to individual cells (or fields) in the data.  If any
  339.   cell fails the  test  for  that  cell,  the  entire  record  is  skipped  for
  340.   additional processing.
  341.  
  342.   Each variable in  the  field-definition  file  can  include  a  cell  filter.
  343.   Filters are specified on the field type records as the last parameters on the
  344.   record and are immediately preceded with "||" indicators:
  345.  
  346.         N 8 Weight || > 100
  347.         N 4 Height || <= 6
  348.         C 10 Name || = Banana
  349.  
  350.   Cell filters can be specified as any one of six relations:
  351.  
  352.      "="  is equal to
  353.      "<"  is less than
  354.      ">"  is greater than
  355.      "<=" is less than or equal to
  356.      ">=" is greater than or equal to
  357.      "<>" is not equal to
  358.  
  359.   You cannot specify ranges.  The item to the right of the relation is  treated
  360.   as a string if the field is non-numeric, otherwise, it's treated as a number.
  361.   Do not include quotes around the strings unless you want that as part of  the
  362.   condition.  The value can include hexadecimal codes (in the &Hxx  format)  or
  363.   decimal codes (in the \ddd format) if necessary (see BRUCEHEX.DOC file).   It
  364.   can also contain spaces.  The cell filter is case  sensitive  (capitalization
  365.   matters).
  366.  
  367.   If the field is being created, you can  specify  an  assignment  cell  filter
  368.   (using "=") which will set the value of that cell as something.  For example:
  369.  
  370.         C      10 First Name
  371.         C  0 0  1 Middle Initial || = ?
  372.         C 10 0 20 Last Name
  373.  
  374.  
  375. Field-definition file for SimTel archives:
  376.  
  377. People    who     use     the     SimTel     archives     (ftp.coast.net     or
  378. http://www.coast.net/SimTel) may find the enclosed SIMIBM.DEF file useful.   It
  379. provides  the  field  definitions  for  the  standard  SIMIBM.IDX  file   (from
  380. subdirectory SimTel/filedocs, download simindex.zip).  The file  includes  some
  381. hints for dropping fields that don't seem to be useful as well  as  restricting
  382. the listing to just those files that have been added since a given date.
  383.  
  384.  
  385. Specifying parameters:
  386.  
  387. Parameters for this program can be set in the following ways.  The last setting
  388. encountered always wins:
  389.   - Read from an *.INI file (see BRUCEINI.DOC file),
  390.   - Through the use of an environmental variable (SET CONVERT=whatever), or
  391.   - From the command line (see "Syntax" below)
  392.  
  393.  
  394. CONVERT.DOC                            9                           Jul 31, 1997
  395.  
  396. Syntax:
  397.  
  398.     CONVERT infile [ outfile [ deffile ] ]
  399.       [ /INDEF=deffile | /-INDEF ] [ /OUTDEF=deffile | /OUTDEF | /-OUTDEF ]
  400.       [ /OVERWRITE | /-OVERWRITE | /APPEND | /OVERASK ]
  401.       [ /FROM FIXED | /FROM ASCII | /FROM DBF ] [ /DELETED ]
  402.       [ /TO FIXED | /TO ASCII | /TO WKS | /TO DBF ] [ /HEADER ]
  403.       [ /DELIMS=aroundstrings,aroundnums,betweenfields ] [ /BEEP ]
  404.       [ /INMISS=val ] [ /INMISSC=val ] [ /OUTMISS=val ] [ /OUTMISSC=val ]
  405.       [ /SKIP | /MISSING | /ABORT ] [ /FIRSTOBS=n ] [ /LASTOBS=n ] [ /-VER ]
  406.       [ /-NULLS ] [ /BINARY ] [ /SCAN=n ] [ /GAP=n ] [ /-CFILTERS ]
  407.       [ /Q | /Qn ] [ /MONO ] [ /Iinitfile | /-I ] [ /-ENV ] [ /? ] [ /?&H ]
  408.  
  409. "infile" is the file specification for the ASCII-delimited or fixed-field  file
  410. you want converted.   You  can  specify  a  drive  and  path  specification  if
  411. necessary.  This parameter is required.
  412.  
  413. "outfile" is the file specification of the file you want to  create.   You  can
  414. specify a drive  and  path  specification  if  necessary.   If  no  outfile  is
  415. provided, the routine will presume you want the output  file  called  the  same
  416. thing as the infile but you want the extension to be ".FIX" (if the output file
  417. is a fixed-field file), ".PRN" (if the  output  file  is  ASCII-delimited),  or
  418. ".WKS" (if the output file is to be in a WKS format).
  419.  
  420. "deffile" is the file specification for the input field-definition  file.   You
  421. can specify a drive and path specification if  necessary.   If  no  deffile  is
  422. specifically provided, the routine will presume it is called the same thing  as
  423. the infile but it has the extension of ".DEF".  Note that the deffile can  only
  424. be provided this way  if  you  also  specify  the  outfile  name;  the  use  of
  425. /INDEF=deffile is recommended instead.
  426.  
  427. "/INDEF=deffile" provides the name of the field-definition file to be  read  by
  428. the program.  If no deffile is specifically  provided  and  you're  using  FROM
  429. ASCII, the routine will presume the field-definition file exists and  is  named
  430. the same thing as the infile but it has the extension of ".DEF".  A deffile has
  431. to be specifically provided for FROM FIXED files if one is desired.
  432.  
  433. "/-INDEF" says there is no field-definition  file.   This  is  the  default  if
  434. you're using FROM DBF or FROM FIXED.
  435.  
  436. "/OUTDEF=deffile" provides the name of  the  output  file  that  you  want  the
  437. program to write the field-definition file to.  This is useful in  cases  where
  438. you did *not* use a field-definition file on input since it allows you  to  see
  439. and possibly modify the field-definition file for next time.
  440.  
  441. "/OUTDEF" says to create the field-definition file and  automatically  name  it
  442. for you.  The file name is the same as the infile with an extension of ".DEF".
  443.  
  444. "/-OUTDEF" says to skip the creation of the field-definition file.  This is the
  445. default for ASCII-delimited and fixed-field files.
  446.  
  447.  
  448. CONVERT.DOC                            10                          Jul 31, 1997
  449.  
  450. "/OVERWRITE" says to overwrite the output file if it exists already.
  451.  
  452. "/-OVERWRITE" says to abort if the output file exists already.
  453.  
  454. "/APPEND" says to append (add) to the output file if it exists  already.   This
  455. option is only available if you're creating  either  a  fixed-field  or  ASCII-
  456. delimited output file.
  457.  
  458. "/OVERASK" says to ask if the output file exists already.   This  is  initially
  459. the default.
  460.  
  461. "/FROM FIXED", "/FROM ASCII", and "/FROM DBF"  specifies  the  format  for  the
  462. input file.  The routine usually reads the input file and  guesses  its  format
  463. for you.  If the routine guesses incorrectly, use the /-VER  parameter  (below)
  464. to overrule it.
  465.  
  466. "/DELETED" applies to dBase input files only.   It  says  you  want  to  retain
  467. records tagged as "deleted".  Otherwise, they're dropped in the output file.
  468.  
  469. "/-DELETED" applies to dBase input files only.  It says to drop records  tagged
  470. as "deleted".  This is initially the default.
  471.  
  472. "/TO FIXED", "/TO ASCII", "/TO WKS", and "/TO DBF" tells the routine what  sort
  473. of output file you'd like to create.  The input and output file formats can  be
  474. the same if desired but you have to explicity specify an output  file  name  in
  475. that case.  Initially defaults to "/TO FIX".
  476.  
  477. "/HEADER" is used in conjunction with WKS  output  files.   If  /HEADER  is  in
  478. effect, the first row of the spreadsheet will contain the variable name for the
  479. cell as provided in your control file.  If none are provided, the  field  names
  480. will be FIELD_01 onward.  Note that the header line (if any) will  show  up  in
  481. the output counts.  Initially defaults to "/-HEADER".
  482.  
  483. "/-HEADER" writes only data to the output WKS file, instead  of  reserving  the
  484. first record for the name of the variable.  This is initially the default.
  485.  
  486. "/DELIMS=aroundstrings,aroundnums,betweenfields"  allows  you  to  specify  the
  487. delimiters (in sequence) around  string  fields,  around  numeric  fields  (any
  488. fields that isn't a character field), and between fields.  Defaults to:
  489.  
  490.         /DELIMS=",,,
  491.  
  492. (Use quotes around character strings, nothing  around  numeric  data,  and  the
  493. third comma indicates that there is a comma between  fields.)  The  replacement
  494. string can include hexadecimal codes (in the &Hxx format) or decimal codes  (in
  495. the \ddd format)  if  necessary  (see  BRUCEHEX.DOC  file)  so  either  of  the
  496. following would put a tab between fields:
  497.  
  498.         /DELIMS=",,&H09
  499.         /DELIMS=",,\009
  500.  
  501. "/BEEP" beeps when the program is finished.
  502.  
  503. "/-BEEP" reverses /BEEP.  Initially the default.
  504.  
  505.  
  506. CONVERT.DOC                            11                          Jul 31, 1997
  507.  
  508. "/INMISS=val" specifies that any numeric value that has  the  character  string
  509. representation of "val" will be considered missing.  Note that this is an exact
  510. character string comparison so /INMISS=1 will not compare to a value of "1.00".
  511. Defaults to /INMISS=NULL (which translates as spaces).
  512.  
  513. "/INMISSC=val" specifies that any character string value that has the value  of
  514. "val" will be considered missing.  Defaults to /INMISSC=NULL (which  translates
  515. as spaces).
  516.  
  517. "/OUTMISS=val"  specifies  that  any  missing  numeric  input  value  will   be
  518. translated on output as "val".  For  example,  "/OUTMISS=N.A."  would  fill  in
  519. "N.A." for each missing value.  Defaults to /OUTMISS=NULL (which translates  as
  520. spaces).
  521.  
  522. "/OUTMISSC=val" specifies that  any  missing  character  input  value  will  be
  523. translated on output as "val".  Defaults to /OUTMISSC=NULL (which translates as
  524. spaces).
  525.  
  526. "/SKIP" says to skip records with bad data values; otherwise the routine aborts
  527. when it runs into any.  /SKIP, /MISSING, and /ABORT are mutually exclusive.
  528.  
  529. "/MISSING" says to presume any missing  fields  in  an  ASCII-delimited  record
  530. should be filled in with blanks  (for  character  fields)  and  0  for  numeric
  531. fields.   Incomplete  records  are  written  out  (unlike  in  /SKIP).   /SKIP,
  532. /MISSING, and /ABORT are mutually exclusive.  Note that the program  will  only
  533. print out the first "bad" record.  There may be others that show up after  this
  534. one.
  535.  
  536. "/ABORT" says to abort when you run into bad records.  Initially  the  default.
  537. /SKIP, /MISSING, and /ABORT are mutually exclusive.
  538.  
  539. "/FIRSTOBS=n" says to start reading the data beginning with  record  number  n.
  540. Initially defaults to "/FIRSTOBS=1".
  541.  
  542. "/LASTOBS=n" says to stop reading the data after record  number  n.   Initially
  543. defaults to "/LASTOBS=2000000000" (2 billion).
  544.  
  545. "/-VER" is used when the  program  verifies  your  input  file  and  mistakenly
  546. determines that it is a file type  other  than  what  it  is.   This  sometimes
  547. happens with fixed-field input files even when /FROM FIXED is specified.
  548.  
  549. "/NULLS" allows fields that begin with decimal 0 to be left in the output  file
  550. as valid values.  Otherwise, they're  treated  as  being  missing.   /NULLS  is
  551. initially the default.
  552.  
  553. "/-NULLS" translates any field  which  begins  with  the  decimal  0  value  as
  554. missing.  For character fields,  it's  translated  to  the  value  of  INMISSC,
  555. numeric fields are switched to the  INMISS  value.   /NULLS  is  initially  the
  556. default.
  557.  
  558.  
  559. CONVERT.DOC                            12                          Jul 31, 1997
  560.  
  561. "/BINARY" says that you have a fixed-field input file  and  that  the  physical
  562. records in this file do not end with the normal  CR/LF  combination.   This  is
  563. fairly typical of files created on a mainframe  or  copied  from  a  tape.   If
  564. /BINARY  is  used,  every  byte  must  be  precisely  accounted  for.   /BINARY
  565. automatically invokes the /FROM FIXED option.
  566.  
  567. "/-BINARY" says that every record ends  with  a  CR/LF  combination.   This  is
  568. fairly standard on files  created  on  a  PC,  even  fixed-field  files.   When
  569. /-BINARY is in effect, trailing fields are ignored.   "/-BINARY"  is  initially
  570. the default.
  571.  
  572. "/SCAN=n" says to read the first n-records  when  determining  the  input  file
  573. characteristics.  This is only relevant for /FROM ASCII  files  which  use  the
  574. /-INDEF option.  The field types are based on the first  record  read  but  the
  575. maximum field widths are determined by reading the first n-records.   Initially
  576. defaults to "/SCAN=100".
  577.  
  578. "/GAP=n" specifies to add n-characters to each output  field  width.   This  is
  579. only relevant for /TO FIXED fields which use the /-INDEF option.  In this case,
  580. n-characters are added to each output field length for non-numeric  fields  and
  581. extra blank fields are added before every numeric field.  This is an  easy  way
  582. of splitting up columns on display.  If you  want  non-uniform  gaps,  you  can
  583. always process the file twice; specify /-INDEF with  /OUTDEF  the  first  time,
  584. modify the field-definition file by hand, and  then  reprocess  the  file  with
  585. /INDEF=filename.  Initially defaults to "/GAP=0".
  586.  
  587. "/CFILTERS" says that if cell filters are  specified  in  the  field-definition
  588. file (for example, "N 3 Age || > 5"), these cell filters are to  be  respected.
  589. This is initially  the  default.   (If  cell  filters  do  not  appear  in  the
  590. field-definition file at all, the switch is ignored.)
  591.  
  592. "/-CFILTERS" says that if cell filters are specified  in  the  field-definition
  593. file, they are to be ignored.  This is useful sometimes if you want  the  whole
  594. file instead of just getting a subset of it.  Note that this switch  will  also
  595. turn off initializing new fields (as in "N 0 0 3 Age || = 12").
  596.  
  597. "/Q" turns off the record-by-record status report.
  598.  
  599. "/Qn" shows a status message every n-number of records.  The default is "/Q25".
  600.  
  601. "/MONO" (or "/-COLOR") does not  try  to  override  screen  colors.   Initially
  602. defaults to "/COLOR".
  603.  
  604. "/COLOR" (or  "/-MONO")  allows  screen  colors  to  be  overridden.   This  is
  605. initially the default.
  606.  
  607. "/Iinitfile" says to read an initialization file with the file name "initfile".
  608. The file specification *must* contain a period.  Initfiles are described in the
  609. BRUCEINI.DOC file.  Initially defaults to "/ICONVERT.INI".
  610.  
  611. "/-I" (or "/INULL") says to skip loading the initialization file.
  612.  
  613.  
  614. CONVERT.DOC                            13                          Jul 31, 1997
  615.  
  616. "/ENV" says to look for %var% occurrences  in  the  command  line  and  try  to
  617. resolve any apparent environmental variable references.  See  BRUCEINI.DOC  for
  618. more information.  This is initially the default.
  619.  
  620. "/-ENV" says to skip resolving apparent %var% occurrences in the command  line.
  621. Initially defaults to "/ENV".
  622.  
  623. "/?" or "/HELP" or "HELP" shows you the syntax for the command.
  624.  
  625. "/?&H" gives you a hexadecimal and decimal conversion table.
  626.  
  627.  
  628. Return codes:
  629.  
  630. CONVERT returns the following ERRORLEVEL codes:
  631.         0 = no problems, file converted
  632.       250 = operation aborted by pressing Escape
  633.       251 = other problems
  634.       252 = problems with input data and /ABORT specified
  635.       253 = problems with INDEF or OUTDEF file
  636.       254 = could not find a decent temporary output subdirectory
  637.       255 = syntax problems, file(s) not found, output file already exists,
  638.             /? requested
  639.  
  640.  
  641.  
  642. CONVERT.DOC                            14                          Jul 31, 1997
  643.  
  644. Restrictions and Caveats:
  645.  
  646.   * The program skips all Memo fields in dBase files on input.
  647.  
  648.   * Most spreadsheet programs restrict a given field length to being 240
  649.     characters or less.
  650.  
  651.   * Date fields which are in the form "yy-mm-dd" (instead of "yyyymmdd") should
  652.     be declared as character fields instead of date fields.
  653.  
  654.   * Date fields converted for WKS files are changed into strings of the
  655.     "yy-mm-dd" format.
  656.  
  657.   * Some users have reported problems using this program when their default
  658.     drive is a network drive instead of a local hard drive.  If you get a
  659.     "path/file access error", make C: your default drive and try again.
  660.  
  661.  
  662. Author:
  663.  
  664.                         Bruce Guthrie
  665.                         Room H-4885
  666.                         U.S. Dept of Commerce/ESA/STAT-USA
  667.                         Washington, DC 20230
  668.  
  669.                         voice: (202) 482-3234
  670.                         e-mail: bguthrie@doc.gov
  671.  
  672. You  may  freely  copy  and  re-distribute  this  program;  however,  the  U.S.
  673. Department of Commerce neither guarantees  nor  assures  compatibility  of  the
  674. program with all computer software or hardware.
  675.  
  676. Additional information about this and other Bruce Guthrie programs can be found
  677. in the file BRUCE.DOC which should be included in the original ZIP  file.   The
  678. recent change history for this and  the  other  programs  is  provided  in  the
  679. HISTORY.ymm file which should be in the same ZIP file where "y" is replaced  by
  680. the last digit of the year and "mm" is the two  digit  month  of  the  release;
  681. HISTORY.611 came out in November 1996.  This same naming convention is used  in
  682. naming the ZIP file (CONVRymm.ZIP) that this program was included in.
  683.  
  684. Please provide an Internet e-mail address on all correspondence.
  685.  
  686. 
  687.